Ghostscript is a PostScript interpreter. PostScript is a language, not a graphic file format. A PostScript file is really a program, not graphical data. The difference is that by looking at a PostScript file you (or an application) cannot easily tell what the file represents. Instead, you must run the file to see what it does. Generally, the result of running a PostScript program is to draw marks on a graphical page. (There are PostScript programs that don't draw anything at all! Some are even distributed as test files with Ghostscript.) This works well for printers but is a bit odd for interactive window systems.
Think of Mac GS Viewer as a virtual printer: Every time you open a file, asking Ghostscript to run it as a PostScript program, the application creates a new sheet of 'paper' and displays it in a window. You can see the program execute as it places marks on the 'paper' in the window (unless your computer is much faster than mine!). Once the program is done, the page is 'ejected' from the printer. However, the application leaves the window on the screen so you can continue to look at it (and scroll it, save it, etc.). But remember, at this point, the page is out of the printer and Ghostscript can no longer change it. If you want to change some parameter (such as scaling), you must change the parameter and then re-open, and thus re-run, the PostScript file.
Please see the file 'readme' and the files that end in '.doc' in the
'files' folder for more information.
The release consists of the following files:
These files are StuffIt archives. If you do not have a program to expand these, you should get the free StuffIt Expander program from your favorite Macintosh archive.
[ 1 ] Unstuff macgs-v1.0-files.sit. It will create a folder named Ghostscript on your disk.
[ 2 ] Unstuff one of the two application files, macgs-v1.0-68k.sit or macgs-v1.0-ppc.sit into the Ghostscript folder. Remember to only unstuff one of them! The Finder gets confused if you have more than one version of an application on a disk.
[ 3 ] Unstuff macgs-v1.0-fonts.sit into the Ghostscript folder as well. This is exactly the same collection of fonts as: ghostscript-fonts-std-3.0.tar.gz it's just in a format most Macintosh users can handle.
You will only need macgs-v1.0-src.sit if you are planning on compiling the program yourself. See the chapter "Building It" for more details.
Launch the application. By default, it will show you the Ghostscript console window, where you can see messages to and from Ghostscript. After a few seconds, all initialization will be done and you will see the 'GS>' prompt in the console window. You don't actually have to wait for the prompt to begin using the program, anything that needs to wait for the prompt will do so automatically if you do it too early.
The program makes extensive use of Balloon Help. Turn it on and explore!
Choosing 'Open' from the 'File' menu lets you choose any TEXT or EPSF file. When you open a file this way, a new window is created, it is presented to Ghostscript for interpretation. This (usually) results in rendering the first page of the file into the window.
If there are more pages in the file, you will see a small alert box with two buttons: 'Next Page' and 'Interrupt'. Clicking the first will clear the window and let Ghostscript continue on with the next page in the file. Clicking the second asks Ghostscript to cancel processing the rest of the file.
Once a file has been rendered, it stays on the screen. You can resize, scroll it, save it (as a PICT file), copy it (to the clipboard). You can have as many windows open as memory allows.
You can change the settings of output media with the "Settings" dialog. Open this dialog by choosing "Settings..." from the "Edit" menu. There are three major sections:
Page Size lets you set the size of the 'logical' page. This is the size that the PostScript file works with.
Scaling lets you enlarge or reduce the 'logical' page to produce the actual output you see. This scaling happens conceptually after the page is printed. However, Ghostscript is aware of this final scaling and will adjust some parameters accordingly (such as halftone screen, or any other parameters that are in 'device coordinates').
Image Options let you select options that pertain to how the image is rendered and recorded.
For example, if you want to render a document that was designed for a Letter size paper, but you want the output to be reduced to half size, then choose "US Letter" for the Page Size and "Half" for the Scaling.
There are too many controls and options in this dialog to discuss here: Turn on balloon help and explore it!
The options apply to all devices (see below), except Image Options which only apply to the 'mac' device.
You can use Mac GS Viewer as a helper application for your web browser. The following steps show how to configure the Netscape browser. If you are using a different browser, the configuration will be similar:
[1] In the Preferences section called Helper Applications, check to see if there is a Mime type application/postscript. If there isn't, then click New... and create one: In the dialog that appears, set the type to application, and the subtype to postscript, then click OK.
[2] Select the application/postscript Mime type by clicking on it.
[3] Set the extensions by typing ai,eps,ps into the Extensions field.
[4] Set the application by clicking the Browse... button. In the dialog that appears, choose the Mac GS Viewer application and click OK. Then choose the File type TEXT from the pop-up menu.
[5] Set the action to Launch Application.
[6] Click OK in the Preferences window to save the changes.
Some browsers, though not Netscape, may need to be restarted before the change will take effect.
IMPORTANT: Postscript includes operators for manipluating files. A buggy or malicious postscript file could damage the files on your harddisk. To minimize this risk, you should start Mac GS Viewer and set the command line in the Preferences to:
-dSAFER
This disable a number of file operations in Ghostscript. Note that there are two problems with this: (a) This option does not claim to be fool proof - Postscript is very powerful and this option can't guard against all possible problems. (b) You will be unable to render to any of the file devices when this is set. However, you still be able to save what you render to the screen as PICT files.
To turn off this feature, you need to remove -dSAFER from the command line in the Preferences dialog, then quit and restart Mac GS Viewer.
Ghostscript supports a large number of graphic output formats. Ghostscript calls these devices. When your copy of the Macintosh port of Ghostscript was built, some devices were chosen to be included. Since there are over a hundred devices, generally not all were included. When you run the application, the devices that are included are listed in the 'Devices' menu. The first one is always 'mac', which is the device for rendering into a Macintosh window.
To use another device, and cause Ghostscript to render into a graphic file, choose the device from the Device menu, and then open the file as normal. This time, instead of a new window appearing, you will be asked to named a file to hold the output. The settings dialog can be used to set the page size and scaling options. Note that the image options have no effect on other devices. To switch back to rendering into a window, just choose 'mac' from the 'Devices' menu.
You can attempt to interrupt Ghostscript from whatever it is doing with the command-period key sequence (it is also available as 'Interrupt' in the 'Ghostscript' menu). Interrupting a PostScript program is inherently unpredictable. This is because a PostScript file can trap the user-interrupt and refuse to stop! Interrupt is implemented so that it should work smoothly in most cases, but you can't be sure. If it doesn't work, hit it a few more times.
Similarly, Quit is also something that a PostScript program can refuse to do! Sometimes, Ghostscript may not appear not to quit. Always give it a few seconds to try. If it just won't quit, the work around is to type: option-command-escape (all at once) to invoke the System 7 Forced Quit dialog.
Ghostscript interprets PostScript programs and renders the graphics that they output. The resulting output image is invariably device dependent. Indeed, the original PostScript file is the device independent form of the image.
Even though the images that Ghostscript renders can be saved in PICT files or on the clipboard in PICT format, these are still device dependent versions of the image: they will not scale well, nor will they display well with different numbers of available colors. These PICT images are simply pixel graphics, not object-oriented graphics. (If you examine these PICT files in a graphics program, you will notice that they are just a single large pixel map.)
The Macintosh device currently renders to any of the following characteristics (which you control in the Settings dialog): 72 dpi 1, 4, or 8 bits per pixel standard Macintosh palettes for 4-bit gray, or 8-bit color
These choices must be made at the time Ghostscript renders an image so that Ghostscript can do its best. For example, Ghostscript will use halftone screens to achieve colors not in the palette.
Though the scaling options may change the dpi from the point of view of the PostScript program, the resulting image on the screen (obviously, as we can't change your hardware on the fly!) and as saved in a PICT file, is 72dpi. For example: If you choose a scaling option of a "Third", the PostScript program appears to render on a 24dpi device, as 24 pixels make up an inch. On the screen, however, 24 pixels make up a third of an inch at 72dpi, thus achieving the 'Third' scaling factor.
The standard Macintosh 8-bit palette is a color cube of 6x6x6 values in RGB space. In addition, it adds evenly spaced ramps of 16 values each of red, green, blue, and gray. Using this palette allows Ghostscript to render with out having the change the palette of a normal 8-bit display system.
There are a number of application settings that can be set with "Preferences" dialog. Open this dialog by choosing "Preferences..." from the "File" menu. There are three major sections:
Command Line lets you choose what the command line is for starting Ghostscript. Generally leaving it empty is fine. You can also choose to have the program ask you each time the program starts.
Windows and Dialogs let you set which windows are shown at start up, and how to handle the Next Page condition. You can choose to have either a sound play or a small dialog appear, or both, when Ghostscript is waiting to display another page.
Remember lets you choose what information is remembered from one invocation of the application to the next.
By default, Ghostscript is started with a blank command line. This can be changed in two ways. First, you can set the command line in the preferences. Second, you can set the preferences to ask you each time the application starts. In this mode, when you start the program, you will see a prompt for command line options in the console window.
Almost everything that can be set on a command line can be set after Ghostscript is running either through the Settings dialog, or by typing into the console window. However, there are few command line options that can be useful:
-v prints version information and then quits -? prints help information and then quits -dDEBUG turns on debugging during initialization Do not set either of the first two as part of a default command line in the Preferences dialog, or each time you start it, Mac GS will display the information and quit.
Features for future releases that I'm considering (these are in no particular order):